package lanqiao;

public class 既约分数 {
    public static void main(String[] args) {
        int count =0;
        for (int i = 1; i <=2020; i++) {
            for (int j = i+1; j <=2020; j++) {
                if (gcd(i,j)!=1){
                    count++;
                }
            }
        }
        System.out.println(count*2+1);
    }
    public static int gcd(int n,int m){
        if (m==0){
            return n;
        }
        return gcd(m,n%m);
    }
}
